#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using pii = pair<int, int>;
using pll = pair<ll, ll>;
#define rep(i, a, b) for (int i = (a); i <= (b); i++)
#define per(i, a, b) for (int i = (a); i >= (b); i--)
#define endl '\n'
const int N = 2e5 + 5;

int n, k;
int f[1 << 20], deg[1 << 20];

vector<vector<int>> ans;
void toposort() {
  rep(i, 0, (1 << k) - 1) deg[i] = k - __builtin_popcount(i);
  vector<int> now;
  queue<int> q;
  q.push((1 << k) - 1);
  while (q.size()) {
    while (q.size()) {
      int u = q.front();
      q.pop();
      if (f[u])
        now.push_back(u);
      else {
        rep(i, 0, k - 1) {
          if ((u >> i) & 1) {
            int v = u ^ (1 << i);
            if (--deg[v] == 0) q.push(v);
          }
        }
      }
    }
    if (now.empty()) break;
    for (int u : now) {
      rep(i, 0, k - 1) {
        if ((u >> i) & 1) {
          int v = u ^ (1 << i);
          if (--deg[v] == 0) q.push(v);
        }
      }
    }
    ans.push_back(now);
    now.clear();
  }
}
int main() {
  ios::sync_with_stdio(0), cin.tie(0), cout.tie(0);
  cin >> n >> k;
  rep(i, 1, n) {
    int x;
    cin >> x;
    f[x] = 1;
  }
  toposort();
  cout << 1 << endl << ans.size() << endl;
  for (auto a : ans) {
    cout << a.size() << ' ';
    for (int x : a) cout << x << ' ';
    cout << endl;
  }
  return 0;
}